package edu.gatech.cs2340.aperturescience.backend.login;

import java.util.List;

/**
 * 
 * @author Kevin Lacey, Jacob Morgan, Kefu Zhou, Kelly Evanish
 * 
 *         Interface for methods required to set up an account.
 */

/**
 * UsersDataSource interface contains the essential methods to manage a Users database
 */
public interface UsersDataSource
{
	/**
	 * opens the database
	 */
	public abstract void open();

	/**
	 * closes the database
	 */
	public void close();

	/**
	 * returns a list of all existing Users
	 * @return - a list of all users
	 */
	public abstract List<User> getAllUsers();

	/**
	 * Determines if the username and password are valid
	 * @param username - the username
	 * @param password - the password
	 * @return - a User object matching the credentials
	 */
	public abstract User getUser(String username, String password);

	/**
	 * Creates a User from the given information.
	 * 
	 * @param username user's username
	 * @param password user's password
	 * @param email user's Email
	 * @param name user's name
	 * @return whether account was succesfully created
	 */
	public abstract boolean createUser(String username, String password,
			String email, String name);

	/**
	 * Checks whether the user account exists.
	 * @param username User's username
	 * @return boolean value for whether or not it exists
	 */
	public abstract boolean userExists(String username);
}
